﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SatisGonderim
{
    public static class Methods
    {
        public static DateTime ToFullDateTime(this string tarih)
        {
            string[] date = tarih.Split(' ')[0].Split('-');
            string[] saat = tarih.Split(' ')[1].Split(':');
            return new DateTime(int.Parse(date[0]), int.Parse(date[1]), int.Parse(date[2]), int.Parse(saat[0]), int.Parse(saat[1]), int.Parse(saat[2]));
        }

        public static DateTime toDate(this string date)
        {
            return new DateTime(int.Parse(date.Substring(0, 4)), int.Parse(date.Substring(4, 2)), int.Parse(date.Substring(6, 2)), int.Parse(date.Substring(8, 2)), int.Parse(date.Substring(10, 2)), int.Parse(date.Substring(12, 2)));
        }

        public static decimal toDecimal(this string veri)
        {
            return Cevir.Parse<decimal>(veri.Replace('.', ','));
        }
    }
}
